//-----------------------------------------------------------------------
// <copyright file="IDSSortCollection.cs" company="Pyramid Consulting">
//     Copyright (c) Pyramid Consulting. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
	
using System;
using System.Collections;
using MyFramework;

namespace MIMS.WRS.Entities
{
	[Serializable]
    public class IDSSortCollection : CollectionBase 
	{

        public IDSSort this[ int index ]  
		{
            get  { return( (IDSSort) List[index] ); }
            set  { List[index] = value;  }
        }

        public int Add( IDSSort value )  
		{
            return( List.Add( value ) );
        }

        public int IndexOf( IDSSort value )  
		{
            return( List.IndexOf( value ) );
        }

        public void Insert( int index, IDSSort value ) 
		{
            List.Insert( index, value );
        }

        public void Remove( IDSSort value ) 
		{
            List.Remove( value );
        }

        public bool Contains( IDSSort value ) 
		{
            // If value is not of type IDSSort, this will return false.
            return( List.Contains( value ) );
        }

        protected override void OnInsert( int index, Object value ) 
		{
            if ( value.GetType() != Type.GetType("MIMS.WRS.Entities.IDSSort") )
                throw new ArgumentException(SR.ModelValueMustBeOfTypeIDSSort, "value" );
        }

        protected override void OnRemove( int index, Object value )  
		{
            if ( value.GetType() != Type.GetType("MIMS.WRS.Entities.IDSSort") )
                throw new ArgumentException(SR.ModelValueMustBeOfTypeIDSSort, "value" );
        }

        protected override void OnSet( int index, Object oldValue, Object newValue )  
		{
            if ( newValue.GetType() != Type.GetType("MIMS.WRS.Entities.IDSSort") )
                throw new ArgumentException(SR.ModelValueMustBeOfTypeIDSSort, "newValue" );
        }

        protected override void OnValidate( Object value )  
		{
            if ( value.GetType() != Type.GetType("MIMS.WRS.Entities.IDSSort") )
                throw new ArgumentException(SR.ModelValueMustBeOfTypeIDSSort);
        }
  }
}